<?php
	// 验证用户是否登录
	require_once 'session-check.php';
	$user = $_SESSION['login_user'];
	
	/**
	 * 站点的留言管理
	 */
	require_once '../util/dbconnection.php';
	require_once '../util/error.php';
	
	$action = $_GET['action'];
	$id = $_GET['id'];
	
	connect_db();
	if( $action == "del" ){
		if( del_fb_by_id($id ) == false ){
			site_die("删除评论失败, 请重试");
		}
	}else if( $action == "pass" ){
		if( pass_fb_by_id( $id ) == false)
			site_die("通过评论失败, 请重试");
	}else if( $action == "destroy" ){
		if( destroy_fb_by_id( $id ) == false)
			site_die("彻底删除评论失败, 请重试");
	}else{
		site_die("错误的请求");
	}
	close_db();
	
	site_redirct("feedback-admin.php");
?>
